//
//  RenHouseDetaMiddleCell.m
//  CenturyCity
//
//  Created by beisheng03 on 2017/12/19.
//  Copyright © 2017年 beisheng. All rights reserved.
//

#import "RenHouseDetaMiddleCell.h"

@interface RenHouseDetaMiddleCell ()
@property (weak, nonatomic) IBOutlet UILabel *oneAreaTopLabel;
@property (weak, nonatomic) IBOutlet UILabel *oneAreaBottomLabel;
@property (weak, nonatomic) IBOutlet UILabel *twoAreaTopLabel;
@property (weak, nonatomic) IBOutlet UILabel *twoAreaBottomLabel;
@property (weak, nonatomic) IBOutlet UILabel *threeAreaTopLabel;
@property (weak, nonatomic) IBOutlet UILabel *threeAreaBottomLabel;
@property (weak, nonatomic) IBOutlet UILabel *fourAreaTopLLabel;
@property (weak, nonatomic) IBOutlet UILabel *fourAreaTopRLabel;
@property (weak, nonatomic) IBOutlet UILabel *fourAreaBottomLLabel;
@property (weak, nonatomic) IBOutlet UILabel *fourAreaBottomRLabel;
@property (weak, nonatomic) IBOutlet UILabel *fiveAreaTopLLabel;
@property (weak, nonatomic) IBOutlet UILabel *fiveAreaTopRLabel;
@property (weak, nonatomic) IBOutlet UILabel *fiveAreaBottomLLabel;
@property (weak, nonatomic) IBOutlet UILabel *fiveAreaBottomRLabel;
@end

@implementation RenHouseDetaMiddleCell

- (void)awakeFromNib {
    [super awakeFromNib];
    
    self.contentView.backgroundColor = [UIColor whiteColor];
    
    self.oneAreaTopLabel.font = MYFONT(14);
    self.oneAreaTopLabel.textColor = darkGray;
    self.oneAreaBottomLabel.font = MYFONT(16);
    self.twoAreaTopLabel.font = MYFONT(14);
    self.twoAreaTopLabel.textColor = darkGray;
//    self.twoAreaBottomLabel.font = MYFONT(16);
    
    self.threeAreaTopLabel.font = MYFONT(14);
    self.threeAreaTopLabel.textColor = darkGray;
    self.threeAreaBottomLabel.font = MYFONT(16);
    self.fourAreaTopLLabel.font = MYFONT(15);
    self.fourAreaTopLLabel.textColor = darkGray;
    self.fourAreaTopRLabel.font = MYFONT(15);
    self.fourAreaBottomLLabel.font = MYFONT(15);
    self.fourAreaBottomLLabel.textColor = darkGray;
    self.fourAreaBottomRLabel.font = MYFONT(15);
    self.fiveAreaTopLLabel.font = MYFONT(15);
    self.fiveAreaTopLLabel.textColor = darkGray;
    self.fiveAreaTopRLabel.font = MYFONT(15);
    self.fiveAreaBottomLLabel.font = MYFONT(15);
    self.fiveAreaBottomLLabel.textColor = darkGray;
    self.fiveAreaBottomRLabel.font = MYFONT(15);
    // Initialization code
}


- (void)setModel:(HouseDetailModel *)model{
    _model = model;
    
    self.oneAreaBottomLabel.text = _model.apartment;
    
    self.twoAreaBottomLabel.attributedText = [self attributedString];
    
    self.threeAreaBottomLabel.text = _model.renting_style;

    self.fourAreaTopRLabel.text = _model.position;
    
    self.fourAreaBottomRLabel.text = _model.decorateStyle;
    
    
    self.fiveAreaTopRLabel.text = [NSString stringWithFormat:@"%@F",_model.house_floor];
    
    self.fiveAreaBottomRLabel.text = _model.houseStyle;
    
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}


- (NSMutableAttributedString *)attributedString{
    
    UIFont *bigFont = MYFONT(16);
//    UIFont *smallFont = MYFONT(7);
    NSMutableAttributedString *attributeString6 = [[NSMutableAttributedString alloc] init];
    NSAttributedString *string26 = [[NSAttributedString alloc] initWithString:[NSString stringWithFormat:@"%@m",_model.house_area] attributes:@{NSFontAttributeName : bigFont,NSForegroundColorAttributeName : [UIColor blackColor],NSBaselineOffsetAttributeName : @(0)}];
    NSAttributedString *string27 = [[NSAttributedString alloc] initWithString:@"2" attributes:@{NSFontAttributeName : [UIFont systemFontOfSize:7],NSForegroundColorAttributeName : [UIColor blackColor],NSBaselineOffsetAttributeName : @(8)}];

    [attributeString6 appendAttributedString:string26];
    [attributeString6 appendAttributedString:string27];
    
    return attributeString6;
    
    
}





/*
 // 设置文本的基线 负数向下  正数向上  0不变
 UIFont *bigFont = [UIFont boldSystemFontOfSize:36];
 UIFont *smallFont = [UIFont boldSystemFontOfSize:bigFont.pointSize / 2];
 CGFloat capHeight = bigFont.pointSize - smallFont.pointSize;
 NSMutableAttributedString *attributeString6 = [[NSMutableAttributedString alloc] init];
 NSAttributedString *string22 = [[NSAttributedString alloc] initWithString:@"￥" attributes:@{NSFontAttributeName : smallFont,NSForegroundColorAttributeName : [UIColor blackColor],NSBaselineOffsetAttributeName : @(0)}];
 NSAttributedString *string23 = [[NSAttributedString alloc] initWithString:@"9" attributes:@{NSFontAttributeName : bigFont,NSForegroundColorAttributeName : [UIColor blueColor],NSBaselineOffsetAttributeName : @(0)}];
 NSAttributedString *string24 = [[NSAttributedString alloc] initWithString:@".99" attributes:@{NSFontAttributeName : smallFont,NSForegroundColorAttributeName : [UIColor blackColor],NSBaselineOffsetAttributeName : @(0)}];
 
 
 NSAttributedString *string28 = [[NSAttributedString alloc] initWithString:@"    七夕大促销    " attributes:@{NSFontAttributeName : [UIFont boldSystemFontOfSize:24],NSForegroundColorAttributeName : [UIColor blackColor],NSBaselineOffsetAttributeName : @(0),NSShadowAttributeName : shadow}];
 
 NSAttributedString *string25 = [[NSAttributedString alloc] initWithString:@"￥" attributes:@{NSFontAttributeName : smallFont,NSForegroundColorAttributeName : [UIColor blackColor],NSBaselineOffsetAttributeName : @(capHeight - 5)}];
 NSAttributedString *string26 = [[NSAttributedString alloc] initWithString:@"0" attributes:@{NSFontAttributeName : bigFont,NSForegroundColorAttributeName : [UIColor redColor],NSBaselineOffsetAttributeName : @(0)}];
 NSAttributedString *string27 = [[NSAttributedString alloc] initWithString:@".09" attributes:@{NSFontAttributeName : smallFont,NSForegroundColorAttributeName : [UIColor blackColor],NSBaselineOffsetAttributeName : @(capHeight - 5)}];
 [attributeString6 appendAttributedString:string22];
 [attributeString6 appendAttributedString:string23];
 [attributeString6 appendAttributedString:string24];
 [attributeString6 appendAttributedString:string28];
 [attributeString6 appendAttributedString:string25];
 [attributeString6 appendAttributedString:string26];
 [attributeString6 appendAttributedString:string27];
 self.label9.attributedText = attributeString6;
 
 
 */

@end
